import { Routes } from '@angular/router';

// 页面组件
import { MainComponent } from './main.component';
import { IndexComponent } from './index/index.component';
import { PrinterComponent } from './printer/printer.component';
import { AddprinterComponent } from './printer/addprinter/addprinter.component';
import { EditprinterComponent } from './printer/editprinter/editprinter.component';
import { PrinterinfoComponent } from './printer/printerinfo/printerinfo.component';
import { PrinterconfigComponent } from './printer/printerconfig/printerconfig.component';
import { SigningComponent } from './printer/signing/signing.component';
import { RolesComponent } from './roles/roles.component';
import { AddroleComponent } from './roles/addrole/addrole.component';
import { EditroleComponent } from './roles/editrole/editrole.component';
import { AcountComponent } from './acount/acount.component';
import { SignlistComponent } from './signlist/signlist.component';
import { PrinterbillComponent } from './printerbill/printerbill.component';
import { PrinterbillinfoComponent } from './printerbill/printerbillinfo/printerbillinfo.component';
import { AddacountComponent } from './acount/addacount/addacount.component';
import { EditacountComponent } from './acount/editacount/editacount.component';
import { InfosettingComponent } from './infosetting/infosetting.component';
import { EditpersoninfoComponent } from './infosetting/editpersoninfo/editpersoninfo.component';
import { EditpasswordComponent } from './infosetting/editpassword/editpassword.component';
import { FeedbackComponent } from './infosetting/feedback/feedback.component';
import { MaintlistComponent } from './maintlist/maintlist.component';
import { AddmaintComponent } from './maintlist/addmaint/addmaint.component';
import { EditmaintComponent } from './maintlist/editmaint/editmaint.component';
import { MaintinfoComponent } from './maintlist/maintinfo/maintinfo.component';
import { TenantlistComponent } from './tenantlist/tenantlist.component';
import { TasklistComponent } from './tasklist/tasklist.component';
import { UserTypeService } from '../../services/user-type.service';
import { LoginguardService } from '../../services/loginguard.service';
import { UserbillComponent } from './userbill/userbill.component';
import { PrintertaskComponent } from './printertask/printertask.component';
import { TaskinfoComponent } from './tasklist/taskinfo/taskinfo.component';
import { MeterlistComponent } from './meterlist/meterlist.component';
import { AddtenantComponent } from './tenantlist/addtenant/addtenant.component';
import { EdittenantComponent } from './tenantlist/edittenant/edittenant.component';
import { TenantinfoComponent } from './tenantlist/tenantinfo/tenantinfo.component';
import { SigninfoComponent } from './signlist/signinfo/signinfo.component';
import { WxpayComponent } from './paymodel/wxpay/wxpay.component';
import { ZfbpayComponent } from './paymodel/zfbpay/zfbpay.component';
import { ManagerlogComponent } from './logs/managerlog/managerlog.component';
import { MaintlogComponent } from './logs/maintlog/maintlog.component';
import { TenantlogComponent } from './logs/tenantlog/tenantlog.component';
import { NotdealfaultComponent } from './notdealfault/notdealfault.component';
import { AddnotdealfaultComponent } from './notdealfault/addnotdealfault/addnotdealfault.component';
import { NOpage404Component } from '../nopage404/nopage404.component';
import { MyfeedbackComponent } from './myfeedback/myfeedback.component';
import { FeedbackinfoComponent } from './myfeedback/feedbackinfo/feedbackinfo.component';

export const MainRoutingModule: Routes = [
  {
    path: '',
    component: MainComponent,
    canActivateChild:[LoginguardService],
    children: [{
      path: '',
      redirectTo: '/main/index',
      pathMatch: 'full'
    },
    { path: 'index', component: IndexComponent, data: { breadcrumb: "首页" } },
    // { path: 'roles', component: RolesComponent, data: { breadcrumb: "角色管理" },canActivate: [UserTypeService]},
    { path: 'roles', component: RolesComponent, data: { breadcrumb: "角色管理" } },
    { path: 'addrole', component: AddroleComponent, data: { breadcrumb: "添加角色" } },
    { path: 'editrole/:id', component: EditroleComponent, data: { breadcrumb: "修改角色" } },
    { path: 'acount', component: AcountComponent, data: { breadcrumb: "账号管理" } },
    { path: 'addacount', component: AddacountComponent, data: { breadcrumb: "添加账号" } },
    { path: 'editacount/:id', component: EditacountComponent, data: { breadcrumb: "修改账号" } },
    { path: 'printer', component: PrinterComponent, data: { breadcrumb: "打印机" } },
    { path: 'addprinter', component: AddprinterComponent, data: { breadcrumb: "添加打印机" } },
    { path: 'editprinter/:id', component: EditprinterComponent, data: { breadcrumb: "修改打印机" } },
    { path: 'printerconfig/:id', component: PrinterconfigComponent, data: { breadcrumb: "预警配置" } },
    { path: 'printerinfo/:id', component: PrinterinfoComponent, data: { breadcrumb: "打印机详情" } },
    { path: 'signing/:id', component: SigningComponent, data: { breadcrumb: "签约打印机" } },
    { path: 'signlist', component: SignlistComponent, data: { breadcrumb: "合同管理" } },
    { path: 'signinfo/:id', component: SigninfoComponent, data: { breadcrumb: "合同详情" } },
    { path: 'userbill', component: UserbillComponent, data: { breadcrumb: "租户账单" } },
    { path: 'printerbill', component: PrinterbillComponent, data: { breadcrumb: "设备抄表账单" } },
    { path: 'printerbillinfo/:id', component: PrinterbillinfoComponent, data: { breadcrumb: "设备抄表账单详情" } },
    { path: 'maintlist', component: MaintlistComponent, data: { breadcrumb: "维修员管理" } },
    { path: 'addmaint', component: AddmaintComponent, data: { breadcrumb: "添加维修员" } },
    { path: 'editmaint/:id', component: EditmaintComponent, data: { breadcrumb: "编辑维修员" } },
    { path: 'maintinfo/:id', component: MaintinfoComponent, data: { breadcrumb: "维修员详情" } },
    { path: 'tenantlist', component: TenantlistComponent, data: { breadcrumb: "租户管理" } },
    { path: 'addtenant', component: AddtenantComponent, data: { breadcrumb: "添加租户" } },
    { path: 'edittenant/:id', component: EdittenantComponent, data: { breadcrumb: "修改租户" } },
    { path: 'tenantinfo/:id', component: TenantinfoComponent, data: { breadcrumb: "租户详情" } },
    { path: 'tasklist', component: TasklistComponent, data: { breadcrumb: "任务工单管理" } },
    { path: 'taskinfo/:id', component: TaskinfoComponent, data: { breadcrumb: "工单任务详情" } },
    { path: 'printertask', component: PrintertaskComponent, data: { breadcrumb: "设备任务管理" } },
    { path: 'meterlist', component: MeterlistComponent, data: { breadcrumb: "设备抄表管理" } },
    { path: 'wxpay', component: WxpayComponent, data: { breadcrumb: "微信收款码管理" } },
    { path: 'zfbpay', component: ZfbpayComponent, data: { breadcrumb: "支付宝收款码管理" } },
    { path: 'managerlog', component: ManagerlogComponent, data: { breadcrumb: "管理员日志" } },
    { path: 'maintlog', component: MaintlogComponent, data: { breadcrumb: "维修员日志" } },
    { path: 'tenantlog', component: TenantlogComponent, data: { breadcrumb: "租户日志" } },
    { path: 'notdealfault', component: NotdealfaultComponent, data: { breadcrumb: "不派单故障" } },
    { path: 'addnotdealfault', component: AddnotdealfaultComponent, data: { breadcrumb: "添加不派单故障" } },
    { path: 'myfeedback', component: MyfeedbackComponent, data: { breadcrumb: "反馈信息" } },
    { path: 'feedbackinfo/:id', component: FeedbackinfoComponent, data: { breadcrumb: "反馈信息详情" } },
    {
      path: 'infosetting/:id', component: InfosettingComponent, children: [
        { path: 'editpersoninfo', component: EditpersoninfoComponent, data: { breadcrumb: "修改资料" } },
        { path: 'editpassword', component: EditpasswordComponent, data: { breadcrumb: "修改密码" } },
        { path: 'feedback', component: FeedbackComponent, data: { breadcrumb: "我要反馈" } }
      ]
    },
    { path: 'page404', component: NOpage404Component },
    { path: '**', component: NOpage404Component },
  ]}
];

